<?php
function getnav(){
    $nav = db('nav_menu')->where('status',1)->select();
    $nav=$nav->toArray();
    foreach($nav as &$value){
        if(strstr($value['href'],'action')){
            $url_earli = json_decode($value['href'],true);
            $url_now = url($url_earli['action'],$url_earli['param']);
        }else{
            $url_now = "/";
        }

        $value['href'] = $url_now;
    }
    return $nav;

}